package com.azusa.xbiao.service.impl;

import com.azusa.xbiao.dao.OrderDao;
import com.azusa.xbiao.entity.Order;
import com.azusa.xbiao.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public List<Order> findArrivalOrder(int uid) {
        return orderDao.findByUIdAndArrival(uid, (byte) 0);
    }

    @Override
    public void save(Order order) {
        orderDao.save(order);
    }

    @Override
    public List<Order> findEvaluateOrder(int uid) {
        return orderDao.findEvaluateOrder(uid, (byte) 1);
    }
}
